{php include wl_template('common/header');}
<ul class="nav nav-tabs">
	<li class="active"><a href="#">运营地区列表</a></li>
</ul>
<div class="app-content">
	<div class="app-filter">
		<div class="filter-list">
			<form action="./index.php" method="get" class="form-horizontal" role="form">
				<input type="hidden" name="c" value="site" />
	            <input type="hidden" name="a" value="entry" />
	            <input type="hidden" name="m" value="{MODULE_NAME}" />
	            <input type="hidden" name="p" value="area" />
				<input type="hidden" name="ac" value="hotarea" />
				<input type="hidden" name="do" value="oparealist" />
				<input type="hidden" name="statusflag" value="{$_GPC['statusflag']}" />
				<input type="hidden" name="ishotflag" value="{$_GPC['ishotflag']}" />
				<div class="form-group">
					<label class="col-sm-2 control-label">是否开启</label>
					<div class="col-sm-9">
						<div class="btn-group">
							<a href="{php echo filter_url('statusflag:0');}" class="btn {if intval($_GPC['statusflag']) == 0}btn-primary{else}btn-default{/if}">不限</a>
							<a href="{php echo filter_url('statusflag:1');}" class="btn {if $_GPC['statusflag'] == 1}btn-primary{else}btn-default{/if}">开启</a>
							<a href="{php echo filter_url('statusflag:2');}" class="btn {if $_GPC['statusflag'] == 2}btn-primary{else}btn-default{/if}">禁用</a>
						</div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">是否热门</label>
					<div class="col-sm-9">
						<div class="btn-group">
							<a href="{php echo filter_url('ishotflag:0');}" class="btn {if intval($_GPC['ishotflag']) == 0}btn-primary{else}btn-default{/if}">不限</a>
							<a href="{php echo filter_url('ishotflag:1');}" class="btn {if $_GPC['ishotflag'] == 1}btn-primary{else}btn-default{/if}">热门</a>
							<a href="{php echo filter_url('ishotflag:2');}" class="btn {if $_GPC['ishotflag'] == 2}btn-primary{else}btn-default{/if}">普通</a>
						</div>
					</div>
				</div>
				<div class="form-group form-inline">
					<label class="col-sm-2 control-label">地区搜索</label>
					<div class="col-sm-9">
						<select name="keywordtype" class="form-control">
							<option value="0" {if $_GPC['keywordtype']==0}selected="selected"{/if}>请选择</option>
							<option value="1" {if $_GPC['keywordtype']==1}selected="selected"{/if}>地区名称</option>
							<option value="2" {if $_GPC['keywordtype']==2}selected="selected"{/if}>所属代理</option>
						</select>
						<input type="text" name="agentname" class="form-control" value="{$_GPC['agentname']}" placeholder="请输入关键字"  />
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"></label>
					<div class="col-sm-9">
						<button class="btn btn-primary">筛选</button>
					</div>
				</div>
			</form>
		</div>
	</div>
	<div class="app-table-list">
		<form class="form form-horizontal form-validate" action="" method="post">
			<input type="hidden" name="statusflag" value="{$_GPC['statusflag']}" />
			<input type="hidden" name="ishotflag" value="{$_GPC['ishotflag']}" />
			<input type="hidden" name="keywordtype" value="{$_GPC['keywordtype']}" />
			<input type="hidden" name="agentname" value="{$_GPC['agentname']}" />
			<div class="table-responsive">
				<table class="table table-hover">
					<thead>
						<tr>
							<th style="width:100px; text-align:center;">编码</th>
							<th style="width:100px; text-align:center;">名称</th>
							<th style="width:100px; text-align:center;">分组</th>
							<th style="width:50px; text-align:center;">排序(数字越大越靠前)</th>
							<th style="width:100px; text-align:center;">所属代理</th>
							<th style="width:100px; text-align:center;">是否开启</th>
							<th style="width:100px; text-align:center;">是否热门</th>
							<th style="width:100px; text-align:center;">操作</th>
						</tr>
					</thead>
					<tbody>
					{loop $addresses $address}
						<tr>
							<td style="white-space: normal;" class="text-center">{if $address['areaid']}{$address['areaid']}{else}--{/if}</td>
							<td class="text-center">{if $address['addressname']}{$address['addressname']}{else}请选择地区{/if}</td>
							<td class="text-center">
								<select name="group[{$address['id']}]" style="width: 100%;" class="select2">
									<option value="0" {if empty($address['gid'])}selected="selected"{/if}>请选择地区分组</option>
									{loop $remark_arr $row}
							            <option value="{$row['id']}" {if $address['gid'] == $row['id']}selected="selected"{/if}>{$row['name']}</option>
									{/loop}
						        </select>
							</td>
							<td class="text-center">
								<input type="number" min="0" class="form-control" value="{$address['sort']}" name="sort[{$address['id']}]" />
							</td>
							<td class="text-center">{$address['agentname']}</td>
							<td class="text-center">
								<input type="checkbox" class="js-switch" name="status[{$address['id']}]" {if $address['status'] == 1} checked="checked" {/if}>
							</td>
							<td class="text-center">
								<input type="checkbox" class="js-switch" name="ishot[{$address['id']}]" {if $address['ishot'] == 1} checked="checked" {/if}>
							</td>
							<td class="text-center">
								<a class="btn btn-success btn-sm" data-toggle="ajaxModal" href="{php echo web_url('area/hotarea/opareaedit', array('id'=>$address['id']))}">编辑地区</a>
							</td>
						</tr>
					{/loop}
					</tbody>
				</table>
			</div>
			{$pager}
			<div class="app-table-foot clearfix">
				<div class="pull-left">
					<input type="hidden" name="token" value="{$_W['token']}" />
					<input name="submit" type="submit" class="btn btn-primary min-width" value="保存">
				</div>
			</div>
		</form>
	</div>
</div>
{php include wl_template('common/footer');}
